package com.xbjtech.ticketsystem.model;

import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

@Table(name = "t_user")
@Data
public class User implements Serializable {

    private static final long serialVersionUID = -1565303863909859297L;

    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(name = "uid")
    private Integer id;

    private String username;

    private String password;

    @Transient
    private Set<Role> roles = new HashSet<>();

    private String state;
}
